<template>
	<view class="empty-container">
		<image src="../static/ic_empty.png" class="empty-ic"></image>
		<view class="row-container" style="margin-top: 14rpx;" @click="clickOpenSettings">
			<text class="font-333-32" style="font-weight: 600;">没有定位，迷路了！</text>
			<text class="font-ffd-32" style="font-weight: 600;">去开启定位</text>
		</view>
		
		<view class="join-container">
			<view class="row-container-top" style="margin-left: 30rpx;margin-top: 30rpx;">
				<image class="logo-ic" src="../static/ic_logo.png"></image>
				<view class="column-container">
					<text class="font-333-34" style="font-weight: 600;">【最星城】{{address}}活动福利...</text>
					<text class="font-999-28" style="margin-top: 4rpx;">群内专属红包 不定期送群员</text>
					<view class="row-container" style="margin-top: 26rpx;">
						<text class="font-999-28">已有</text>
						<text class="font-333-28" style="font-weight: 600;">{{peopleCount}}</text>
				 		<text class="font-999-28">人加入</text>
					</view>
				</view>
			</view>
			<view class="join-btn" @click="clickJoinGroup">立即加群</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"noLocation",
		data() {
			return {
				peopleCount:0,
				address:'',
			};
		},
		props: {
			type: {
				type: String,
				default: 'index'
			},
		},
		
		created() {
			this.peopleCount = getApp().globalData.groupPeopleCount
			this.address = getApp().globalData.address
			let that = this
			uni.$on("updateGroupInfo" , ()=>{
				that.peopleCount = getApp().globalData.groupPeopleCount
				that.address = getApp().globalData.address
			})
		},
		
		methods:{
			clickOpenSettings(){
				uni.openSetting({
					success(res){
						console.log('openSettings----' + res)
						uni.$emit("openLocationSuccess")
					}
				})
			},
			
			clickJoinGroup(){
				uni.$emit("openGroupImgWindow" , this.$props.type)
			}
		}
	}
</script>

<style lang="scss">
	.empty-container{
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 50rpx;
		width: 100%;
		z-index: 20;
		position: relative;
		
		.empty-ic{
			width: 70rpx;
			height: 70rpx;
			margin-bottom: 30rpx;
		}
		
		.join-container{
			width: calc(100% - 60rpx);
			background: white;
			border-radius: 16rpx;
			margin-top: 40rpx;
			display: flex;
			flex-direction: column;
			padding-top: 30rpx;
			padding-bottom: 30rpx;
			
			.logo-ic{
				width: 156rpx;
				height: 156rpx;
				margin-right: 26rpx;
				flex-shrink: 0;
			}
			
			.join-btn{
				width: calc(100% - 60rpx);
				height: 88rpx;
				border-radius: 16rpx;
				background: #FFD110;
				line-height: 88rpx;
				text-align: center;
				margin-top: 40rpx;
				margin-left: 30rpx;
				margin-right: 30rpx;
				color: #333333;
				font-size: 36rpx;
				font-weight: 600;
	
			}
			
		}
	}
</style>